/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package study.alex.db;

import java.util.Random;

/**
 *
 * @author RERIR
 */
public class randomString {
    private int maxLen;

    public randomString(int maxLen) {
        
        if (maxLen < 1) this.maxLen = 1;
        else this.maxLen = maxLen;
    }
    
    public String nextString() {
        
        Random rnd = new Random();
        
        char[] ch = new char[rnd.nextInt(maxLen)];
        for (int i = 0; i < ch.length; i++) {
            ch[i] = (char)(rnd.nextInt((int)'z'-(int)'0')+(int)'0');
        }
        return new String(ch);
    }
}
